public class test
{
   public static void main(String[] Args)
   {
      int[] a = {1,2};
      swap(a);
      System.out.print("a[0]=" + a[0] + " a[1]=" + a[1]);
   }
   
   public static void swap(int[] a)
   {
      int temp = a[0];
      a[0] = a[1];
      a[1] = temp;
   }
   
}